home *** CD-ROM | disk | FTP | other *** search
- Path: mother.usf.edu!scheifler!millert
- From: millert@scheifler.csee.usf.edu (Timothy Miller)
- Newsgroups: comp.lang.c++
- Subject: Trying to do weird function overloading
- Date: 26 Feb 1996 00:36:31 GMT
- Organization: University of South Florida
- Message-ID: <4gqvaf$msv@mother.usf.edu>
- NNTP-Posting-Host: scheifler.csee.usf.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- Ok... here's a piece of one of my classes:
-
- friend Color scale(Color c1, double f);
- friend Color scale(double f, Color c2);
- Color scale(double f) { return scale(*this, f); }
-
- In the member function, I'm trying to call the friend function, but the
- compiler is thinking that I'm trying to call the member function. Now,
- if I were trying to do this the other way around, I could use the scope
- resolution operator to tell the friend function that I'm trying to access
- the member function (even though I wouldn't need to, right?). But here,
- I'm trying to do the exact opposite... so how would I scope resolve outward?
-
- --
- ---------------------------------------------------------------------------
- Timothy Miller, millert@grad.csee.usf.edu Theoretical Linguistics
- http://www.csee.usf.edu/~millert Music Theory, Computer Engineering
- ---------------------------------------------------------------------------
- Cunning linguists are very skilled with their tongues.
-